//== GAIA ============================================================================

//== BEGINNING OF CODE ===============================================================

#include "sagittarius/core/SagittariusCore.h"

#include <stdio.h>
//#include <malloc.h>
#include <assert.h>
#include "sagittarius/session/session.h"

int main(int argc, char* argv[])
{
    int i;
    sg_sclass c;
    sg_pageheap* ph;
    sg_span* s;
    size_t b;
    #define NUM_DO 100
    void* obj[NUM_DO];
    sg_session ses;
    
    //init
    init_session(&ses);
    
    c = 4;
    ph = &ses.smoheap.heaps[c];
    s = &ph->spans[0];
    b = s->bs;
    printf("block size = %lu, object bytes = %lu\n", b, sg_sc_nbytes(c));
    //allocate
    //for(i=0; i<NUM_DO; ++i) {
        //obj[i] = smo_allocs_b(s);
    //}
    obj[0] = smo_allocs_b(s);
    *(uint16*)obj[0] = 0xBBCC;
    //span_dump_sate(1, s);
    smo_frees(s, obj[0]);
    span_dump_sate(1, s);
    //free
    for(i=0; i<NUM_DO; ++i) {
        //smo_frees(s, obj[i]);
    }
    
    return 0;
}
